package com.wei.czz.common.property;

import com.wei.czz.common.tool.BaseEntity;
import lombok.Getter;
import lombok.Setter;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;
import org.springframework.validation.annotation.Validated;

import javax.validation.constraints.NotNull;

/**
 * Created by IntelliJ IDEA.
 *
 * @author wyw
 * date: 2024-05-16 11:17:33
 * className: SnowflakeProperty
 * version: 1.1
 * description:
 */
@Getter
@Setter
@Component
@ConfigurationProperties(prefix = "snowflake")
@Validated
public class SnowflakeProperty extends BaseEntity {

    /**
     * 数据中心个数
     * <p>[1-32]之间的正整数
     */
    @NotNull(message = "数据中心个数不能为空")
    private Integer dataCount;

    /**
     * 工作机器个数
     * <p>[1-32]之间的正整数
     */
    @NotNull(message = "工作机器个数不能为空")
    private Integer workCount;

}
